{
  let arr = Array.of(3,4,7,9,11);
  console.log('arr=',arr);
  //arr= (5) [3, 4, 7, 9, 11]
  let empty=Array.of();
  console.log('empty',empty);
}

{
  // 伪数组转换成数组..dom节点获取的是伪数组
  let p=document.querySelectorAll('p');
  console.log('p',p)
  let pArr=Array.from(p);
  pArr.forEach(function(item){
    console.log(item.textContent);
  });
    let obj = {
        "0" : 9,
        "1" : 10,
        "2" : 11,
        length : 3
    };
    let arr = Array.from(obj);
    console.log(arr);
    // 转换成数组之后对每个元素进行操作，并且返回新的值ff
  console.log(Array.from([1,3,5],function(item){return item*2}));
  console.log('obj:',Array.from(obj,function(item){return item*3}));
//   [2, 6, 10]
}

{
  console.log('fill-7',[1,'a',undefined].fill(7));
  // [7, 7, 7]  填充替换
  console.log('fill,pos',['a','b','c','g','m'].fill(7,1,3));
//         ["a", 7, 7, "g", "m"] 从指定坐标替换
//     用7 替换区间[1,2)
}

{
  //  数组遍历
    //索引遍历，
  for(let index of ['1','c','ks'].keys()){
    console.log('keys',index);
  }
  //值遍历
  for(let value of ['1','c','ks'].values()){
    console.log('values',value);
  }
    //值遍历，索引跟值一起遍历
  for(let [index,value] of ['1','c','ks'].entries()){
    console.log('values',index,value);
  }
}

{
  // [4, 2, 3, 4, 5, 6, 7, 8, 9]  这个没什么用
  console.log([1,2,3,4,5,6,7,8,9].copyWithin(0,3,4));
}

{
  console.log([1,2,3,4,5,6].find(function(item){return item>3}));
  console.log([1,2,3,4,5,6].findIndex(function(item){return item>3}));
}

{
  console.log('number',[1,2,NaN].includes(1));
  console.log('number',[1,2,NaN].includes(NaN));
}
